package models;

import javax.persistence.Embeddable;

@Embeddable
public class LinkPK
{
    public long id_structure;
    public long id_parent;
    public long id_child;

    public boolean equals(Object object)
    {
	if (object instanceof LinkPK)
	{
	    LinkPK linkPK = (LinkPK) object;
	    return id_structure == linkPK.id_structure
		    && id_parent == linkPK.id_parent
		    && id_child == linkPK.id_child;
	}
	else
	{
	    return false;
	}
    }

    public int hashCode()
    {
	String hash = String.valueOf(id_structure)+
		String.valueOf(id_parent)+
		String.valueOf(id_child);
	return (int) (hash).hashCode();
    }
}
